package com.lineage.server.utils.collections;

import java.util.Map;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class CTRAssignLock {
  private static final Log LOG = LogFactory.getLog(CTRAssignLock.class);
  
  private static final Map<Integer, Lock> GRDINVLOCKMAP = UMapFactory.newHashMap();
  
  public static void registerGrdIvnLock(Integer mapId) {
    GRDINVLOCKMAP.put(mapId, new ReentrantLock(true));
  }
  
  public static Lock getGrdIvnLock(int mapId) {
    return GRDINVLOCKMAP.get(new Integer(mapId));
  }
  
  public static void removeGrdIvnLock(Integer mapId) {
    GRDINVLOCKMAP.remove(mapId);
  }
}
